<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.blockchain.console.servlets.financial.gd.GdSu"%>
<%@page import="com.blockchain.common.enums.GdState"%>
<%@page import="com.blockchain.console.servlets.financial.gd.GdglList"%>
<%@page import="com.blockchain.console.servlets.financial.gd.GdCheck"%>
<%@page import="com.blockchain.console.service.financial.entity.GdglRecord"%>
<%@page import="java.math.BigDecimal"%>
<%@page import="java.text.DecimalFormat"%>
<html>
<head>
<%@include file="/WEB-INF/include/meta.jsp"%>
<%@include file="/WEB-INF/include/style.jsp"%>
</head>
<%
	GdglRecord gdglRecord = ObjectHelper.convert(
				request.getAttribute("gdglRecord"), GdglRecord.class);
	if(gdglRecord==null)
	{
		response.sendError(HttpServletResponse.SC_NOT_FOUND);
		return;
	}
%>
<%
		CURRENT_CATEGORY = "CWGL";
			CURRENT_SUB_CATEGORY = "GDGL";
	%>
<body>
	<%@include file="/WEB-INF/include/header.jsp"%>
	<div class="w_main">
		<div class="main clearfix">
			<div class="wrap">
				<div class="r_main">
					<form action="<%=controller.getURI(request, GdSu.class)%>" method="post" id="form1">
						<input type="hidden" name="id" value="<%=gdglRecord.pdid%>"> <input type="hidden" name="status" id="status">
						<div class="home_main">
							<div class="box box1 mb15">
								<div class="atil">
									<h3>审核</h3>
								</div>
								<div class="con">
									<div class="clear"></div>
									<ul class="cell noborder yw_jcxx">
										<li>
											<div class="til">流水号：</div>
											<div class="info"><%=gdglRecord.id%></div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">挂单人用户名：</div>
											<div class="info">
											<%StringHelper.filterHTML(out, gdglRecord.loginName);%>
											</div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">挂单人姓名：</div>
											<div class="info">	
												<%StringHelper.filterHTML(out, gdglRecord.userName);%>
											</div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">拍单数量：</div>
											<div class="info">	
												<%=Formater.formatAmount(gdglRecord.pdsl)%>
											</div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">挂单单价：</div>
											<div class="info">	
												<%=Formater.formatAmount(gdglRecord.gddj)%>
											</div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">收款方式：</div>
											<div class="info">	
												<%StringHelper.filterHTML(out, gdglRecord.zfType.getName());%>
											</div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">收款账号：</div>
											<div class="info">	
												<%
													StringHelper.filterHTML(out, gdglRecord.skzh);
												%>
											</div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">联系电话：</div>
											<div class="info">	
												<%
													StringHelper.filterHTML(out, gdglRecord.lxdh);
												%>
											</div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">挂单时间：</div>
											<div class="info">	
												 <%=DateTimeParser.format(gdglRecord.gdsj,"yyyy-MM-dd HH:mm")%>
											</div>
											<div class="clear"></div>
										</li>
										<%if(gdglRecord.pdState==GdState.SSZ){ %>
										<li>
											<div class="til">拍下时间：</div>
											<div class="info">	
												<%=DateTimeParser.format(gdglRecord.pdsj,"yyyy-MM-dd HH:mm")%>
											</div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">拍下人用户名：</div>
											<div class="info">	
												<%StringHelper.filterHTML(out, gdglRecord.bloginName);%>
											</div>
											<div class="clear"></div>
										</li>
										<li>
											<div class="til">拍下人姓名：</div>
											<div class="info">	
												<%StringHelper.filterHTML(out, gdglRecord.buserName);%>
											</div>
											<div class="clear"></div>
										</li>
									</ul>
									<div class="tc pt20" style="width:360px;margin:auto">
										<a href="<%=controller.getURI(request, GdglList.class)%>" class="btn5 mr30">返回</a>
										<a href="javascript:void(0)" onclick="check('<%=GdState.JYCG.name()%>')" class="btn3 mr10">强制拨币</a> 
										<a href="javascript:void(0)" onclick="check('<%=GdState.QZQX.name()%>')" class="btn3 mr10">强制取消拍单</a>
									</div>
									<%} %>
									<div class="clear"></div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
			<%@include file="/WEB-INF/include/left.jsp"%>
		</div>
	</div>
	<%
		String warringMessage=controller.getPrompt(request, response, PromptLevel.WARRING);
		if(!StringHelper.isEmpty(warringMessage))
		{
	%>
	<div class="w440 thickbox thickpos" style="margin:-80px 0 0 -220px;" id="showDiv">
      <div class="info clearfix">
        <div class="clearfix">
            <span class="fl tips"><%StringHelper.filterHTML(out, warringMessage); %></span>
        </div>
        <div class="dialog_btn"><input type="button" name="button2" onclick="$('#showDiv').hide()" value="确认"  class="btn4 ml50"/></div> 
      </div>
	</div>
	<%} %>
	<%@include file="/WEB-INF/include/footer.jsp"%>
	<%@include file="/WEB-INF/include/script.jsp"%>
	<script type="text/javascript" src="<%=controller.getStaticPath(request)%>/js/txgl/withdrawals.js"></script>
	<script type="text/javascript">
		reason();
		$("#reason").focus(function() {
			$("#reason").attr("value", "");
			$("#reason").css("color", "");
		});
		$("#reason").blur(function() {
			reason();
		});
		function reason() {
			var reason = $("#reason").val();
			if (reason == "") {
				$("#reason").attr("value", "如不通过需填写具体原因");
				$("#reason").css("color", "gray");
			} else if (reason == '如不通过需填写具体原因') {
				$("#reason").css("color", "gray");
			}
		}
		function check(status) {
			var reason = $("#reason").val();
			$("#status").attr("value", status);
			if (status =='<%=GdState.SHSB%>' && (reason == "" || reason == '如不通过需填写具体原因')) {
				alert("请填写不通过的原因!");
				return;
			} else if (status == '<%=GdState.GDZ%>' && reason == '如不通过需填写具体原因') {
				$("#reason").attr("value", "");
			}
			$("#form1").submit();
		}
	</script>
</body>
</html>